package com.example.dormitorysystem.mapper;

import com.example.dormitorysystem.entity.Rooms;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 吉吉王国组
 * @since 2022-11-26
 */
public interface RoomsMapper extends BaseMapper<Rooms> {

    @Select("select id, name, order_num remarks, describes, image_url, sum " +
            "from rooms " +
            "where gender = #{gender} and building_id = #{buildingId} and is_valid = 1 and is_del = 0" )
    List<Rooms> selectRoomsAndBeds(Integer buildingId, Integer gender);
}
